home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr10 / rmast40.zip / DEMO1.C < prev    next >
C/C++ Source or Header  |  1994-01-12  |  900b  |  33 lines

  1. /* ************************************************************ */
  2. /* Demo1.c For Turbo C                                          */
  3. /*                                                              */
  4. /* TGCAR.XGF was created by saving the image as  TP/TC (Binary) */
  5. /* from Raster Master.                                          */
  6. /* ************************************************************ */
  7.  
  8. #include <stdio.h>
  9. #include <alloc.h>
  10. #include <graphics.h>
  11.  
  12. void main()
  13. {
  14.   void *imgBuf;
  15.   FILE *F;
  16.   int driver = VGA;
  17.   int mode   = VGALO;
  18.   unsigned int size;
  19.  
  20.   F=fopen("TGCAR.XGF","rb");
  21.   size=filelength(fileno(F));
  22.   imgBuf = malloc(size);
  23.   fread(imgBuf,size,1,F);
  24.   fclose(F);
  25.  
  26.   initgraph(&driver, &mode, "");
  27.   setfillstyle(SOLID_FILL,BLUE);
  28.   bar(0,0,getmaxx(),getmaxy());
  29.   putimage(0,0,imgBuf,COPY_PUT);
  30.   free(imgBuf);
  31.   getch();
  32.   closegraph();
  33. }